import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../controllers/forgot_pwd_controller.dart';

class ForgotPwdView extends GetView<ForgotPwdController> {
  const ForgotPwdView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFEDF3FA),
      appBar: AppBar(
        title: Text(
          '忘记密码',
          style: TextStyle(
            fontSize: 32.sp,
            fontFamily: 'Source Han Sans CN',
            color: const Color(0xFF333333),
          ),
        ),
        backgroundColor: const Color(0xFFEDF3FA),
        elevation: 0,
        centerTitle: true,
        leading: IconButton(
          icon: Icon(
            Icons.arrow_back_ios,
            color: const Color(0xFF333333),
            size: 40.sp,
          ),
          onPressed: () => Get.back(),
        ),
      ),
      body: Padding(
        padding: EdgeInsets.symmetric(horizontal: 30.w),
        child: Column(
          children: [
            SizedBox(height: 100.h),
            // 手机号输入框
            Container(
              width: 690.w,
              height: 110.h,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(20.r),
              ),
              child: Row(
                children: [
                  SizedBox(width: 30.w),
                  Text(
                    '手机号',
                    style: TextStyle(
                      fontSize: 28.sp,
                      fontFamily: 'Source Han Sans',
                      color: const Color(0xFF333333),
                      height: 1.0,
                    ),
                  ),
                  SizedBox(width: 60.w),
                  Expanded(
                    child: TextField(
                      keyboardType: TextInputType.phone,
                      decoration: InputDecoration(
                        hintText: '请输入手机号',
                        hintStyle: TextStyle(
                          fontSize: 28.sp,
                          fontFamily: 'Source Han Sans CN',
                          color: const Color(0xFF999999),
                          height: 1.0,
                        ),
                        border: InputBorder.none,
                        contentPadding: EdgeInsets.zero,
                      ),
                      style: TextStyle(
                        fontSize: 28.sp,
                        fontFamily: 'Source Han Sans CN',
                        color: const Color(0xFF333333),
                      ),
                    ),
                  ),
                  SizedBox(width: 30.w),
                ],
              ),
            ),
            SizedBox(height: 41.h),
            // 验证码输入框
            Container(
              width: 690.w,
              height: 110.h,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(20.r),
              ),
              child: Row(
                children: [
                  SizedBox(width: 30.w),
                  Text(
                    '验证码',
                    style: TextStyle(
                      fontSize: 28.sp,
                      fontFamily: 'Source Han Sans',
                      color: const Color(0xFF333333),
                      height: 1.0,
                    ),
                  ),
                  SizedBox(width: 60.w),
                  Expanded(
                    child: TextField(
                      keyboardType: TextInputType.number,
                      decoration: InputDecoration(
                        hintText: '请输入手机验证码',
                        hintStyle: TextStyle(
                          fontSize: 28.sp,
                          fontFamily: 'Source Han Sans',
                          color: const Color(0xFF999999),
                          height: 1.0,
                        ),
                        border: InputBorder.none,
                        contentPadding: EdgeInsets.zero,
                      ),
                      style: TextStyle(
                        fontSize: 28.sp,
                        fontFamily: 'Source Han Sans CN',
                        color: const Color(0xFF333333),
                      ),
                    ),
                  ),
                  GestureDetector(
                    onTap: () {
                      // 获取验证码逻辑
                    },
                    child: Text(
                      '获取验证码',
                      style: TextStyle(
                        fontSize: 28.sp,
                        fontFamily: 'Source Han Sans',
                        color: const Color(0xFF047FF7),
                        height: 1.0,
                      ),
                    ),
                  ),
                  SizedBox(width: 30.w),
                ],
              ),
            ),
            const Spacer(),
            // 修改密码按钮
            GestureDetector(
              onTap: () {
                // 跳转到重新设置密码页面
                Get.toNamed('/reset-pwd');
              },
              child: Container(
                width: 690.w,
                height: 88.h,
                margin: EdgeInsets.only(bottom: 100.h),
                decoration: BoxDecoration(
                  color: const Color(0xFFDEEDFF),
                  borderRadius: BorderRadius.circular(20.r),
                  border: Border.all(
                    color: const Color(0xFF79B4F9),
                    width: 1.w,
                  ),
                ),
                child: Center(
                  child: Text(
                    '修改密码',
                    style: TextStyle(
                      fontSize: 28.sp,
                      fontFamily: 'Source Han Sans CN',
                      color: const Color(0xFF333333),
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
